# 构造函数：创建类时初始化对象的属性的函数方法
class Employee:
    def __init__(self, name, id):  # 定义属性
        self.name = name
        self.id = id

    def print_info(self):
        print(f"员工名字：{self.name},工号：{self.id}")


class FullTimeEmployee(Employee):
    def __init__(self, name, id, monthly_salary):
        super().__init__(name, id)                   #self.name = name  和 self.id = id继承过来
        self.monthly_salary = monthly_salary


class PartTimeEmployee(Employee):
    def __init__(self, name, id, daily_salary, work_days):
        super().__init__(name, id)                   #self.name = name  和 self.id = id继承过来
        self.daily_salary = daily_salary
        self.work_days = work_days

    def calculate_salary(self):
        return self.daily_salary * self.work_days


zhaojiakang = FullTimeEmployee("赵家康", 120000, 20000)
xuqing = PartTimeEmployee("徐晴", 120001, 300, 6)
zhaojiakang.print_info()
xuqing.print_info()
print(zhaojiakang.monthly_salary)
print(xuqing.calculate_salary())
